﻿using System;
using System.Collections.Generic;
using System.Text;
using Core;
using Core.Image;
using System.Drawing.Imaging;
using System.Drawing;
using System.IO;

namespace WebTest
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GetImage thumb = new GetImage("http://www.baidu.com", 1024, 768, 320, 240);
            System.Drawing.Bitmap img = thumb.GetBitmap();
            img.Save("d:\\website.jpg", ImageFormat.Jpeg);

            Graphics g = Graphics.FromImage(img);
            g.DrawString("xxxxx", (new Font("Arial", 10)), (new SolidBrush(Color.Blue)), 3, 3);//’在矩形内绘制字串（字串，字体，画笔颜色，左上x.左上y）
            MemoryStream ms = new MemoryStream();
            img.Save(ms, ImageFormat.Png);
            Response.ClearContent();
            Response.ContentType = "image/Png";
            Response.BinaryWrite(ms.ToArray());
            g.Dispose();
            img.Dispose();
            Response.End();
        }

    }
}
